package com.athena.dal.entities;

import java.io.Serializable;
import javax.persistence.*;

import java.sql.Timestamp;
import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the student database table.
 * 
 */
@Entity
@Table(name="student")
@PrimaryKeyJoinColumn(name="id")
public class Student extends User implements Serializable  {
	private static final long serialVersionUID = 1L;


	@Column(nullable=false, length=45)
	private String alias;

	@Temporal(TemporalType.DATE)
	@Column(nullable=false)
	private Date classJoinedDate;

	@Column(nullable=false)
	private int rollNumber;

	@Column(nullable=false)
	private Timestamp updatedAt;

	//bi-directional many-to-one association to Attendance
	@OneToMany(mappedBy="student")
	private Set<Attendance> attendances;

	//bi-directional many-to-one association to Guardian
	@OneToMany(mappedBy="student")
	private Set<Guardian> guardians;

	//bi-directional many-to-one association to Mark
	@OneToMany(mappedBy="student")
	private Set<Marks> marks;

	//bi-directional many-to-one association to Result
	@OneToMany(mappedBy="student")
	private Set<Result> results;

	//bi-directional many-to-one association to Class
	@ManyToOne
	@JoinColumn(name="classId", nullable=false)
	private Class clazz;

	public Student() {
	}

	public String getAlias() {
		return this.alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public Date getClassJoinedDate() {
		return this.classJoinedDate;
	}

	public void setClassJoinedDate(Date classJoinedDate) {
		this.classJoinedDate = classJoinedDate;
	}

	public int getRollNumber() {
		return this.rollNumber;
	}

	public void setRollNumber(int rollNumber) {
		this.rollNumber = rollNumber;
	}

	public Timestamp getUpdatedAt() {
		return this.updatedAt;
	}

	public void setUpdatedAt(Timestamp updatedAt) {
		this.updatedAt = updatedAt;
	}

	public Set<Attendance> getAttendances() {
		return this.attendances;
	}

	public void setAttendances(Set<Attendance> attendances) {
		this.attendances = attendances;
	}

	public Set<Guardian> getGuardians() {
		return this.guardians;
	}

	public void setGuardians(Set<Guardian> guardians) {
		this.guardians = guardians;
	}

	public Set<Marks> getMarks() {
		return this.marks;
	}

	public void setMarks(Set<Marks> marks) {
		this.marks = marks;
	}

	public Set<Result> getResults() {
		return this.results;
	}

	public void setResults(Set<Result> results) {
		this.results = results;
	}

	public Class getClazz() {
		return this.clazz;
	}

	public void setClazz(Class clazz) {
		this.clazz = clazz;
	}

}